﻿//Please note, I can not take credit for this script.
//I found it while searching the newsgroups. Someone named Steve wrote it.
//Kudos to Steve, who ever you are,
//this is the best pause function I have found.

//In your main "action" timeline, frame 1 put the following code:
////////////////// Pause Function /////////////////////
this.createEmptyMovieClip("timer",50);
timer.onEnterFrame = function()
{
        if (this.startTime>0)
        {
                var diff = getTimer()-this.startTime;
                if (diff>this.timerLength)
                {
                        this.target.play();
                        this.startTime = 0;
                }
        }
};
function pauseFor(theTime)
{
        stop();
        timer.timerLength = theTime;
        timer.startTime = getTimer();
        timer.target = this;
}
///////////////////////////////////////////////////
//Then on the frame you want to pause, add: pauseFor(3000)
//this would pause for 3 seconds.